package com.szh.cloud.api.user.service;

import com.szh.cloud.api.user.entity.ApiSearchUserEntity;
import com.szh.cloud.mybatis.eltree.ElTreeResult;
import com.szh.cloud.mybatis.entity.PtUserEntity;
import com.szh.cloud.mybatis.flexigrid.PagingBean;
import com.szh.cloud.user.entity.UserEntity;
import com.szh.cloud.user.execption.RepeatEmailException;
import com.szh.cloud.user.execption.RepeatMobileException;
import com.szh.cloud.user.execption.RepeatUserNameException;
import com.szh.cloud.user.execption.UseNameCcupdException;

import java.util.List;

public interface ApiUserService {
    /**
     * 分页查询
     * @param entity
     * @param paging
     * @return
     */
    List<PtUserEntity> queryUserListByPage(ApiSearchUserEntity entity, PagingBean paging);

    /**
     * 查询用户总数量
     * @param entity
     * @return
     */
    Integer queryUserListTotal(ApiSearchUserEntity entity);

    /**
     * 增加用户
     * @param entity
     * @return
     */
    void addUser(UserEntity entity) throws RepeatEmailException, RepeatUserNameException, RepeatMobileException;

    /**
     * 修改用户
     * @param userEntity
     */
    void editUser(UserEntity userEntity) throws RepeatEmailException, RepeatUserNameException, RepeatMobileException;

    /**
     * 删除用户到回收站
     * @param userUuids
     */
    void deleteUserRecycleById(String userUuids) throws UseNameCcupdException;

    /**
     * 查询角色ztree
     * @param userUuid
     * @return
     */
    ElTreeResult queryRoleTreeByUser(String userUuid);

    /**
     * 保存用户和角色关系
     * @param userUuids
     * @param roleIds
     */
    void saveRoleByUser(String userUuids, String roleIds);
}
